#ifndef _TREE_H_
#define _TREE_H_

#include "Object.h"
#include "TreeNode.h"

namespace MySTL
{

template < typename T >
class Tree : public Object
{
public:
	Tree();

	virtual bool insert(const T& value, TreeNode<T>* parent) = 0;
	virtual bool insert(TreeNode<T>* node) = 0;
	virtual bool remove(TreeNode<T>* node, bool need_to_delete = true) = 0;
	virtual TreeNode<T>* find(const T& value) const = 0;
	virtual TreeNode<T>* find(TreeNode<T>* node) const = 0;
	virtual TreeNode<T>* root() const = 0;
	virtual int degree() const = 0;
	virtual int height() const = 0;
	virtual int count() const = 0;
	virtual void clear() = 0;

	virtual bool begin() = 0;
	virtual bool end() = 0;
	virtual bool next() = 0;
	virtual TreeNode<T>* current() = 0;

protected:
	Tree(const Tree& obj);
	Tree& operator =(const Tree& obj);

protected:
	TreeNode<T>* m_root;
};

template < typename T >
Tree<T>::Tree()
{
	m_root = NULL;
}

}

#endif